<template>
  <div>
    <div class="head">
      <p class="text">应用管理</p>
      <van-icon
        @click="onClickLeft()"
        size="20"
        color="whitesmoke"
        name="arrow-left"
        class="icon"
      />
    </div>
    <div>
      <van-tabs
        background="#6c90f3"
        title-inactive-color="white"
        class="index_tab van_tab"
        v-model="active"
        @click="onClick"
        sticky
      >
        <van-tab title="下载记录" title-style="font-size:20px">
          <br />
          <div class="appcla1">
            <br />
            <div class="appcla1-1" v-for="(item, index) in list" :key="index">
              <van-image
                radius="10"
                class="guess_like_img"
                width="50"
                height="50"
                :src="item.app_image_road"
              />
              <span class="appcla1-1-1">{{ item.app_name }}</span>
              <span class="appcla1-1-2"
                >下载次数：{{ item.app_downloding_times }}</span
              >
              <!-- <van-button class="appbtn1" size="small" round type="info"
                >更新</van-button
              > -->
              <van-icon name="arrow" class="appbtn1"/>
            </div>
          </div>
        </van-tab>
        <van-tab title="应用更新" title-style="font-size:20px">
          <br />
       <div class="appcla1">
            <br />
            <div class="appcla1-1" v-for="(item, index) in list" :key="index">
              <van-image
                radius="10"
                class="guess_like_img"
                width="50"
                height="50"
                :src="item.app_image_road"
              />
              <span class="appcla1-1-1">{{ item.app_name }}</span>
              <span class="appcla1-1-2"
                >下载次数：{{ item.app_downloding_times }}</span
              >
              <van-button class="appbtn1" size="small" round type="info"
                >更新</van-button
              >
              <!-- <van-icon name="arrow" class="appbtn1"/> -->
            </div>
          </div>

        </van-tab>
      </van-tabs>
    </div>

    <!-- <div class="appcla1">
      <br />
      <div class="appcla1-1" v-for="(item, index) in list" :key="index">
        <van-image
          radius="10"
          class="guess_like_img"
          width="50"
          height="50"
          :src="item.app_image_road"
        />
        <span class="appcla1-1-1">{{ item.app_name }}</span>
        <span class="appcla1-1-2"
          >下载次数：{{ item.app_downloding_times }}</span
        >
        <van-button class="appbtn1" size="small" round type="info"
          >更新</van-button
        >
      </div>
    </div> -->
  </div>
</template>
<script>
import http from '../api/index';
export default {
  data() {
    return {
      list: [],
    };
  },
  methods: {
    onClickLeft() {
      this.$router.push('/mine');
    },
  },
  mounted() {
    http
      .myRecords({
        user_id: 1,
      })
      .then((r) => {
        console.log(r);
        this.list = r.data;
      });
   http.myAppUpdate({
       user_id: 1,
   }).then((r) => {
        console.log(r);
        this.list = r.data;
      }); 
  },
};
</script>
<style  scoped>
.head {
  width: 100%;
  height: 4rem;
  background-color: rgb(108, 144, 243);
}
.text {
  text-align: center;
  font-size: 1.6rem;
  color: whitesmoke;
  line-height: 4rem;
}
.icon {
  position: absolute;
  top: 1.1rem;
  /* left: 0px; */
}
.appcla1 {
  width: 96%;
  margin: 0 auto;
  border-radius: 1.5rem;
  background-color: white;
}
.appcla1-1 {
  width: 96%;
  height: 6rem;
  position: relative;
  margin-top: 2rem;
}
.appbtn1 {
  position: absolute;
  top: 0.8rem;
  right: 0px;
  width: 7rem;
}
.appcla1-1-1 {
  position: absolute;
  top: 0.1rem;
  left: 8.5rem;
  font-size: 1.8rem;
  color: #252525;
}
.appcla1-1-2 {
  position: absolute;
  top: 3rem;
  left: 8.5rem;
  font-size: 1.4rem;
  color: #7a7a7a;
}
</style>